<template>
  <h1 :class='titleClass'>Make me red</h1> <!-- 此处添加一个动态 class 绑定 -->
  <h1 :class='titleClass2'>Make me red</h1> <!-- 此处添加一个动态 class 绑定 -->
</template>

<script setup lang="ts">
import { ref, reactive } from 'vue'

const titleClass = reactive({ title: true, })
const titleClass2 = ref('aaa')
titleClass2.value = 'title'
</script>

<style scoped>
.title {
  color: red;
}
</style>